#ifndef WINDOWADDS_H
#define WINDOWADDS_H

class WindowAdds;

#include "common.h"


class WindowAdds
{
public:
	struct Size
	{
		int Width;
		int Height;
	};

	struct ReducedData
	{
		Size Size;
	};

	WindowAdds(HINSTANCE hInstance);
	~WindowAdds();
		
	void Add(HWND hWnd);
	void Remove(HWND hWnd);
	bool Exists(HWND);	
private:
	map<HWND, ReducedData> windowsForReducing;
	int menuHeight;
	int captionHeight;
	int frameHeight;
	int smallCaptionHeight;
	int minHeight;
	int minSmallHeight;

	void ResetReducedWindows();
	void ReduceWindowsExceptOne(HWND, HWND = (HWND)-1);
	void RestoreReducedWindow(HWND);
	void ReduceWindow(HWND);
	
	static set<WindowAdds*> instances;
	static HWINEVENTHOOK hWinEventHook;

	static HHOOK hMouseHook;
	static bool mouseHookActive;
	static HINSTANCE hInstance;

	static VOID CALLBACK WinEventProc(HWINEVENTHOOK hWinEventHook, DWORD dwEvent, HWND hWnd, LONG idObject, LONG idChild, DWORD idEventThread, DWORD dwmsEventTime);


	static LRESULT CALLBACK MouseHookProc(int code, WPARAM wParam, LPARAM lParam);
};

#endif